import time

from unit01.Base.Base import Base
from selenium.webdriver.common.by import By

class Page(Base):
    # 登录
    login_loc = (By.LINK_TEXT, '登录')
    #输入用户名
    user_loc=(By.NAME,'username')
    # 输入密码
    password_loc=(By.NAME,'password')
    #强制等待
    #点击登录
    denglu_loc=(By.XPATH,'//*[@id="theForm"]/div[5]/a')

    def login(self):
        self.click(self.login_loc)

    def user(self,info):
        self.send_keys(self.user_loc,info)

    def password(self):
        self.send_keys(self.password_loc,'121212')

    def denglu(self):
        self.click(self.denglu_loc)

    def a3mall_denglu_01(self,info):
        self.open_url('http://10.59.9.12:7001/')
        self.login()
        time.sleep(2)
        self.user(info)
        self.password()
        time.sleep(8)
        self.denglu()
